//package me.ezitku.base.extensions
//
//import android.app.Activity
//import android.support.v4.app.Fragment
//import com.ug_project.objects.isNotNull
//import me.ezitku.base.R
//import pay.alert.Alerter
//
///**
// * Created by yurqi on 2017/5/18.
// */
//
//fun Activity.alert(title: String, content: String? = null, duration: Long = 1000) {
//    Alert().apply {
//        this.title = title
//        this.duration = duration
//        content.isNotNull {
//            this.content = content!!
//        }
//        show(this@alert)
//    }
//}
//
//fun Fragment.alert(title: String, content: String? = null, duration: Long = 1000) {
//    activity.alert(title,content,duration)
//}
//
//fun Activity.errAlert() {
//    alert(getString(R.string.text_failed))
//}
//
//fun Activity.errAlert(msg: String) {
//    alert(getString(R.string.text_failed), msg)
//}
//
//fun Fragment.errAlert() {
//    activity.errAlert()
//}
//
//fun Fragment.errAlert(msg: String) {
//    activity.errAlert(msg)
//}
//
//
//private class Alert {
//    var title: String = ""
//    var content: String = ""
//    var duration = 1000L
//    fun show(activity: Activity) {
//        Alerter.create(activity)
//                .setTitle(title)
//                .setText(content)
//                .setDuration(duration)
//                .setBackgroundColor(me.ezitku.base.R.color.app_color)
//                .show()
//    }
//
//}